package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type AppConfig struct {
	Mysql
}
type Mysql struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
}

var Appconf AppConfig

func Init() {
	viper.SetConfigFile("appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.UnmarshalExact(&Appconf)
	fmt.Println("配置文件动态读取", Appconf)
}
